Skip to content

Conversation

@Bubble-Interface
Copy link

@Bubble-Interface Bubble-Interface commented Dec 20, 2025

closes #13731

Clarify in the capturing tutorial that using capture fixtures such as capsys or capfd re-enables capturing for the duration of the test, even when global capturing is disabled via -s or --capture=no.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Dec 20, 2025
@Bubble-Interface
Copy link
Author

The docs build failure appears to be unrelated to this change.
It looks like an incompatibility between Sphinx 9.0.4 and sphinxcontrib-trio (KeyError: 'autofunction').
Happy to rebase or update once the docs toolchain is fixed.

@Bubble-Interface
Copy link
Author

@Zac-HD Could you please check if that what you had in mind for the issue?

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks for the PR, @Bubble-Interface!

(the CI failure looks unrelated to me)

@nicoddemus
Copy link
Member

The CI failure is being addressed in #14067.

Comment on lines +135 to +143
.. note::

When a capture fixture such as :fixture:`capsys` or :fixture:`capfd` is used,
it takes precedence over the global capturing configuration set via
command-line options such as ``-s`` or ``--capture=no``.

This means that output produced within a test using a capture fixture will
still be captured and available via ``readouterr()``, even if global capturing
is disabled.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this note to the bottom of the page. This is a more advanced notice, and as it is now, it gets in the way of the explanation of the basics of the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disabling capture in cli doesn't work

3 participants